import request from '@/utils/request'

// 查询上课预约列表
export function listAppoint(query) {
  return request({
    url: '/debao/appoint/list',
    method: 'get',
    params: query
  })
}

// 查询上课预约详细
export function getAppoint(id) {
  return request({
    url: '/debao/appoint/' + id,
    method: 'get'
  })
}

/**
 * 获取课程学员列表
 * @param id
 * @returns {*}
 */
export function courseUserList(courseId) {
  return request({
    url: '/debao/appoint/courseUserList/' + courseId,
    method: 'get'
  })
}

/**
 * 获取教练自己的课程的列表
 * @returns {*}
 */
export function courselist(coachId) {
  return request({
    url: '/debao/appoint/list/' + coachId,
    method: 'get',
  })
}

// 新增上课预约
export function addAppoint(data) {
  return request({
    url: '/debao/appoint',
    method: 'post',
    data: data
  })
}

// 修改上课预约
export function updateAppoint(data) {
  return request({
    url: '/debao/appoint',
    method: 'put',
    data: data
  })
}

// 删除上课预约
export function delAppoint(id) {
  return request({
    url: '/debao/appoint/' + id,
    method: 'delete'
  })
}
